﻿/*******************************************************************************
 * AAEngine
 * Copyright (c) 2010 Mike Jarosch
 *
 * This file is licensed under the terms of the MIT license, which is included
 * in the "MIT License.txt" file at the root directory of this SDK.
 ******************************************************************************/

using System.Collections.Generic;

namespace AAEngine.Engine.Core
{
    public static class IListExtensions
    {
        public static T Shift<T>(this IList<T> @this)
        {
            T first = @this[0];
            @this.RemoveAt(0);
            return first;
        }

        public static void Push<T>(this IList<T> @this, T item)
        {
            @this.Insert(0, item);
        }

        public static T Pop<T>(this IList<T> @this)
        {
            T first = @this[0];
            @this.RemoveAt(0);
            return first;
        }
    }
}
